package com.zp.collection;

import java.util.Iterator;
import java.util.TreeSet;

public class TreeSetTest3 {
	public static void main(String[] args){
		
		TreeSet<Person> set = new TreeSet<Person>(new PersonComparator());
		
		set.add(new Person(10));
		set.add(new Person(20));
		set.add(new Person(30));
		
		for(Iterator<Person> iter = set.iterator();iter.hasNext();){
			Person p = iter.next();
			System.out.println(p.score);
		}
	}
}
